package com.xxgc.demo.controller.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

@Schema(description = "实名认证VO")
@Data
public class UserInfoIdCardVO {

    @NotNull(message = "id不能为空")
    @Schema(description = "用户id",requiredMode = Schema.RequiredMode.REQUIRED)
    //int不支持@NoutNull 需要改成Integer
    private Integer id;

    @NotNull(message = "姓名不能为空")
    @Size(min = 2,message = "姓名最小两位")
    @Pattern(regexp = "^[\u4e00-\u9fa5]+$",message = "姓名只能出现中文")
    @Schema(description = "姓名",requiredMode = Schema.RequiredMode.REQUIRED)
    private String name;

    @NotNull(message = "身份证不能为空")
    @Pattern(regexp = "^\\d{6}(18|19|20)\\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\\d|3[01])\\d{3}[0-9Xx]$",message = "身份证必须是中国有效身份证")
    @Schema(description = "身份证",requiredMode = Schema.RequiredMode.REQUIRED)
    private String idCard;
}
